import apis from "@/api/apis.js"

export default{
	namespaced: true,
	state:{
		totalData:[],
		allMoneyData:[],
		productType:''
	},
	mutations:{
		setTotalData(state,newData){
			state.totalData = newData.ownRegularBeans,
			state.allMoneyData=newData
		}
	},
	actions:{
		
		//定期购买
		async getBuyMonrys(context,details){
			const data = await apis.detailBuy.getBuyMonrys(details)
			// console.log(data)
			return data
		},
		
		//定期渲染
		 async getFundMoney(context,memberName){
			 const data = await apis.detailBuy.getFundMoney(memberName)
			 // console.log(data)
			 if(data.code == 200){
			 	context.commit('setTotalData', data.data)
			 }
		 },
		 
		 //转出
		 async getRollt(context,sells){
		 	const data = await apis.detailBuy.sell(sells)
		 	// console.log(data)
		 	return data
		 }
		
	}
}